package com.fishing.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fishing.entity.OperLog;
import com.fishing.mapper.OperLogMapper;
import com.fishing.service.OperLogService;

@Service
public class OperLogServiceImpl implements OperLogService{
	
	@Autowired
	private OperLogMapper operLogMapper;

	@Override
	public int deleteByPrimaryKey(Integer id) throws Exception {
		return operLogMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(OperLog record)  throws Exception{
		return operLogMapper.insert(record);
	}

	@Override
	public OperLog selectByPrimaryKey(Integer id)  throws Exception{
		return operLogMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<OperLog> selectAll(String PageIndex, String PageCount) throws Exception {
		Map<String,Object> map = new HashMap<String, Object>();
		map.put("PageIndex", (Integer.parseInt((PageIndex)) - 1) * Integer.parseInt(PageCount));
		map.put("PageCount", Integer.parseInt(PageCount));
		return this.operLogMapper.selectAll(map);
	}

	@Override
	public int selectCount() throws Exception {
		return this.operLogMapper.selectCount();
	}

    
}
